<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Creates a DOMDocument object of the specified type with its document element</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="domimplementation.construct.html">DOMImplementation::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="domimplementation.createdocumenttype.html">DOMImplementation::createDocumentType</a></div>
 <div class="up"><a href="class.domimplementation.html">DOMImplementation</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="domimplementation.createdocument" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DOMImplementation::createDocument</h1>
  <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">DOMImplementation::createDocument</span> &mdash; <span class="dc-title">
   Creates a DOMDocument object of the specified type with its document element
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-domimplementation.createdocument-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="type"><a href="class.domdocument.html" class="type DOMDocument">DOMDocument</a></span> <span class="methodname"><strong>DOMImplementation::createDocument</strong></span>
    ([ <span class="methodparam"><span class="type">string</span> <code class="parameter">$namespaceURI</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
   [, <span class="methodparam"><span class="type">string</span> <code class="parameter">$qualifiedName</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
   [, <span class="methodparam"><span class="type"><a href="class.domdocumenttype.html" class="type DOMDocumentType">DOMDocumentType</a></span> <code class="parameter">$doctype</code><span class="initializer"> = <strong><code>NULL</code></strong></span></span>
  ]]] )</div>

  <p class="para rdfs-comment">
   Creates a <a href="class.domdocument.html" class="classname">DOMDocument</a> object of the specified type
   with its document element. 
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-domimplementation.createdocument-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">namespaceURI</code></em></dt>

     <dd>

      <p class="para">
       The namespace URI of the document element to create.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">qualifiedName</code></em></dt>

     <dd>

      <p class="para">
       The qualified name of the document element to create.
      </p>
     </dd>

    
    
     <dt>
<em><code class="parameter">doctype</code></em></dt>

     <dd>

      <p class="para">
       The type of document to create or <strong><code>NULL</code></strong>.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-domimplementation.createdocument-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   A new <a href="class.domdocument.html" class="classname">DOMDocument</a> object. If 
   <em><code class="parameter">namespaceURI</code></em>, <em><code class="parameter">qualifiedName</code></em>, 
   and <em><code class="parameter">doctype</code></em> are null, the returned 
   <a href="class.domdocument.html" class="classname">DOMDocument</a> is empty with no document element
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-domimplementation.createdocument-errors">
  <h3 class="title">错误／异常</h3>
  <p class="para">
   <dl>

    
     <dt>
<strong><code>DOM_WRONG_DOCUMENT_ERR</code></strong></dt>

     <dd>

      <p class="para">
       Raised if <em><code class="parameter">doctype</code></em> has already been used with a 
       different document or was created from a different implementation.
      </p>
     </dd>

    
    
     <dt>
<strong><code>DOM_NAMESPACE_ERR</code></strong></dt>

     <dd>

      <p class="para">
       Raised if there is an error with the namespace, as determined by 
       <em><code class="parameter">namespaceURI</code></em> and <em><code class="parameter">qualifiedName</code></em>.
      </p>
     </dd>

    
   </dl>

  </p>
  <p class="para">此方法<em class="emphasis">可以</em>被静态调用,但会抛出一个 <strong><code>E_STRICT</code></strong> 错误。</p>
 </div>

 <div class="refsect1 seealso" id="refsect1-domimplementation.createdocument-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="methodname"><a href="domdocument.construct.html" class="methodname" rel="rdfs-seeAlso">DOMDocument::__construct()</a> - Creates a new DOMDocument object</span></li>
    <li class="member"><span class="methodname"><a href="domimplementation.createdocumenttype.html" class="methodname" rel="rdfs-seeAlso">DOMImplementation::createDocumentType()</a> - Creates an empty DOMDocumentType object</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="domimplementation.construct.html">DOMImplementation::__construct</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="domimplementation.createdocumenttype.html">DOMImplementation::createDocumentType</a></div>
 <div class="up"><a href="class.domimplementation.html">DOMImplementation</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
